﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Silverlight3dApp.Learning.Lesson07
{
    public class SpinningEnemy : BasicModel
    {
        protected Matrix _Rotation = Matrix.Identity;

        public Matrix Rotation
        {
            get
            {
                return _Rotation;
            }
        }

        public SpinningEnemy(Model model) : base(model)
        {
        }

        public override void Update()
        {
            _Rotation *= Matrix.CreateRotationY(MathHelper.Pi / 180);
            base.Update();
        }

        public override Matrix World
        {
            get
            {
                return base.World * _Rotation;
            }
        }
    }
}